﻿using System;
using System.Collections.Generic; 
using System.Text;
using ATSModel;
using System.Data.SqlClient;
using System.Data;

namespace ATSDAL
{
   public class TRCUStatusCheck : BaseRepository_DT<RCUStatusCheck>
    {
        #region 静态变量定义部分
        private const string PARM_TEST_PRODUCTSN = "@ProductSN";
        #endregion

        // 通过SN，获取SN对应RCU检测结果（标签打印软件对接）
        public RCUStatusCheck RcuResult_GetbySN(string ProductSN)
        {
            SqlParameter[] parms = GetParams();
            parms[0].Value = ProductSN;

            return ExcuteSqlToGetEntity("WEB_RcuResult_GetbySN", parms);
        }

        private static SqlParameter[] GetParams()
        {
            SqlParameter[] parms = null;
            parms = new SqlParameter[]
            { 
                new SqlParameter(PARM_TEST_PRODUCTSN, SqlDbType.NVarChar, 50)
            };
            return parms;
        }

        public override RCUStatusCheck GetEntityRecord(SqlDataReader rdr)
        {
            RCUStatusCheck pro = new RCUStatusCheck
            {
                Status = rdr.GetValue(0).ToString(),
            };
            return pro;
        }

        public override RCUStatusCheck GetEntityRecord()
        {
            RCUStatusCheck pro = new RCUStatusCheck();
            return pro;
        }
    }
}
